// 通知管理相关 API
import request from '@/utils/request';
import { PageParams, PageResult } from '@/types/common';
import { NotificationInfo } from '@/types/system';

export const notificationApi = {
  // 获取通知列表
  getNotifications: (params: PageParams): Promise<PageResult<NotificationInfo>> =>
    request.get('/notifications', params),

  // 标记通知为已读
  markAsRead: (id: string): Promise<void> =>
    request.patch(`/notifications/${id}/read`),

  // 批量标记为已读
  batchMarkAsRead: (ids: string[]): Promise<void> =>
    request.post('/notifications/batch-read', { ids }),

  // 删除通知
  deleteNotification: (id: string): Promise<void> =>
    request.delete(`/notifications/${id}`),

  // 获取未读通知数量
  getUnreadCount: (): Promise<{ count: number }> =>
    request.get('/notifications/unread-count'),
}; 